import { GetterTree } from "vuex";
import { State } from "./state";

export type Getters = {
  completeCount(state: State): number;
  totalCount(state: State): number;
};

export const getters: GetterTree<State, State> & Getters = {
  completeCount: state => state.todoList.filter(item => item.completed).length,
  totalCount: state => state.todoList.length
};
